<template lang="">
  <div>
    <div class="ser_div">
      <el-row>
        <el-col :span="4">
          <!-- <el-button
            @click="model_number_click"
            style="margin-left: 15px; background: #1890ff; color: aliceblue"
          >
            搜索</el-button
          > -->
          <el-button
            @click="add_model"
            style="background: #1890ff; color: aliceblue"
            >新增型号</el-button
          >
        </el-col>
      </el-row>
    </div>
    <el-table
      :data="ModelList"
      stripe
      style="width: 100%"
      border
    >
      <el-table-column prop="modelname" label="名称"> </el-table-column>
      <el-table-column label="操作" width="250" fixed="right">
          <template slot-scope="scope">
            <el-button
              @click="push_ziduan(scope.row)"
              type="text"
              >字段列表</el-button>
            <el-button
              @click="set_moxing(scope.row)"
              type="text"
              style="margin-left: 10px" 
              >修改</el-button
            >
            <el-popconfirm
              confirm-button-text="确定"
              cancel-button-text="取消"
              icon="el-icon-info"
              icon-color="red"
              title="确定删除该模型吗？"
              @confirm="del_moxing(scope.row)"
            >
              <el-button
                slot="reference"
                type="text"
                style="margin-left: 10px"  
                >删除</el-button
              >
            </el-popconfirm>
          </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { getModelList,addModel } from "@/api/product/index";
export default {
    data(){
        return{
            ModelList:[] 
        }
    },
    mounted(){
        this.get_ModelList()
    },
    methods:{
        get_ModelList(){
            let obj={
                is_dropdown:1
            }
            getModelList(obj).then(res=>{
                if(res.code==200){
                    this.ModelList=res.data
                }
            })
        },
        push_ziduan(row){
            this.$router.push({
                name: "ziduanlist",
                path: "/ziduanlist",
                query: {
                    data: row.modelid,
                },
            })
        },
        set_moxing(){},
        del_moxing(){},
        add_model(){

        },
        add_Model(){
          addModel().then(res=>{

          })
        }
    }
};
</script>
<style lang="">

</style>
